﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Alogient.Cameleon.Sdk
{
    public class Constants
    {
        private Constants() { }

        public const string OriFileFormat_Live = "{0}{1}_{2}_{3}_0_{4}";
        public const string PresFileFormat_Live = "{0}{1}_{2}_{3}_1_{4}";
        public const string ThumbFileFormat_Live = "{0}{1}_{2}_{3}_2_{4}";
        public const string PathFileFormat_Live = "{0}{1}_{2}_{3}_{4}_{5}";

        public const string OriFileFormat_Preview = "{0}Preview_{1}_{2}_{3}_0_{4}";
        public const string PresFileFormat_Preview = "{0}Preview_{1}_{2}_{3}_1_{4}";
        public const string ThumbFileFormat_Preview = "{0}Preview_{1}_{2}_{3}_2_{4}";
        public const string PathFileFormat_Preview = "{0}Preview_{1}_{2}_{3}_{4}_{5}";

        public static string GetMediaFileFormat()
        {
            if (CMServices.IsLive)
            {
                return OriFileFormat_Live;
            }
            
            return OriFileFormat_Preview;
        }

        public static string GetFileFormat()
        {
            if (CMServices.IsLive)
            {
                return PathFileFormat_Live;
            }
            
            return PathFileFormat_Preview;
        }

        public static string GetFileFormat(ImageFileType imageFileType)
        {
            return string.Format(GetFileFormat(), "{0}", "{1}", "{2}", "{3}", ImageFileTypeHelper.GetImageFileTypeCode(imageFileType), "{4}");
        }
    }
}
